<?php
  
  $type = $vars['type'];
  $class = $vars['class'];
  $js = $vars['js']; 
  $values = $vars['categories']; 
  $prefix = $vars['prefix_name'];
  
  foreach ($values as $key => $value) {
     $input .= '<label><input type = "' .$type. '" name = "'. $prefix . '" value= "'.$key . '" checked onClick="'. $js. '(this.value, this.checked, this.name, this.form)" class="' .$class .'"/>'.$value.'</label> </br>';
  }
  echo $input;

?>